package com.dave.admin.modular.boss.controller;

import cn.hutool.core.util.StrUtil;
import com.dave.admin.common.exception.AssertionEx;
import lombok.Getter;
import org.springframework.beans.factory.InitializingBean;

/**
 * @author Dave
 */
@Getter
public abstract class BaseController implements InitializingBean {


    /**
     * 权限的前缀：例如 Menu  ,Account
     */
    protected String permissionPrefix;


    @Override
    public void afterPropertiesSet() {
        setPermissionPrefix();
        AssertionEx.isTrue(StrUtil.isNotBlank(permissionPrefix), "权限的前缀不能为空");
    }

    /**
     * set permPrefix for extender
     */
    public abstract void setPermissionPrefix();
}
